package Consumer;

import java.util.function.Consumer;


/***
 * 对于 Consumer，我们需要提供入参，用来被消费，如下面这段示例代码：
 */
public class Person {

    String firstName;
    String lastName;

    Person() {}

    Person(String firstName, String lastName) {
        this.firstName = firstName;
        this.lastName = lastName;
    }

    public static void main(String[] args){
        Consumer<Person>  greeter = (p) -> System.out.println("hello," + p.firstName);
        greeter.accept(new Person("Luke","Skywalker"));

    }
}
